<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--<%@ taglib prefix="fm" uri="http://www.springframework.org/tags/form" %>--%>
<%
    String path = request.getProtocol() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
%>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>App基础信息维护</title>
    <base href="<%=path%>"/>

    <!-- Bootstrap -->
    <link href="/statics/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awe/some -->
    <link href="/statics/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="/statics/css/nprogress.css" rel="stylesheet">
    <!-- iCheck -->
    <link href="/statics/css/green.css" rel="stylesheet">
    <!-- Datatables -->
    <link href="/statics/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">
    <link href="/statics/datatables.net-buttons-bs/css/buttons.bootstrap.min.css" rel="stylesheet">
    <link href="/statics/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css" rel="stylesheet">
    <link href="/statics/datatables.net-responsive-bs/css/responsive.bootstrap.min.css" rel="stylesheet">
    <link href="/statics/datatables.net-scroller-bs/css/scroller.bootstrap.min.css" rel="stylesheet">

    <!-- Custom Theme Style -->
    <link href="/statics/css/custom.min.css" rel="stylesheet">
    <%--<style>--%>
    <%--.form-group{--%>
    <%--display:block;--%>
    <%--float: left;--%>
    <%--}--%>
    <%--</style>--%>
</head>

<body class="nav-md" >
<div class="container body">
    <div class="main_container">
        <div class="col-md-3 left_col">
            <div class="left_col scroll-view">
                <div class="navbar nav_title" style="border: 0;">
                    <a href="index.html" class="site_title"><i class="fa fa-paw"></i> <span>APP BMS</span></a>
                </div>
                <div class="clearfix"></div>
                <!-- menu profile quick info -->
                <div class="profile">
                    <div class="profile_pic">
                        <img src="images/img.jpg" alt="..." class="img-circle profile_img">
                    </div>
                    <div class="profile_info">
                        <span>欢迎</span>
                        <h2>${user.usercode}</h2>
                    </div>
                </div>
                <!-- /menu profile quick info -->
                <br/>
                <!-- sidebar menu -->
                <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
                    <div class="menu_section">
                        <h3>${user.username}</h3>
                        <ul class="nav side-menu">
                            <li><a><i class="fa fa-home"></i>APP管理<span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="index.html">Dashboard</a></li>
                                    <li><a href="index2.html">Dashboard2</a></li>
                                    <li><a href="index3.html">Dashboard3</a></li>
                                </ul>
                            </li>
                            <li><a><i class="fa fa-edit"></i>用户管理<span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="form.html">General Form</a></li>
                                    <li><a href="form_advanced.html">Advanced Components</a></li>
                                    <li><a href="form_validation.html">Form Validation</a></li>
                                    <li><a href="form_wizards.html">Form Wizard</a></li>
                                    <li><a href="form_upload.html">Form Upload</a></li>
                                    <li><a href="form_buttons.html">Form Buttons</a></li>
                                </ul>
                            </li>
                            <li><a><i class="fa fa-desktop"></i>基础数据维护<span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="general_elements.html">General Elements</a></li>
                                    <li><a href="media_gallery.html">Media Gallery</a></li>
                                    <li><a href="typography.html">Typography</a></li>
                                    <li><a href="icons.html">Icons</a></li>
                                    <li><a href="glyphicons.html">Glyphicons</a></li>
                                    <li><a href="widgets.html">Widgets</a></li>
                                    <li><a href="invoice.html">Invoice</a></li>
                                    <li><a href="inbox.html">Inbox</a></li>
                                    <li><a href="calendar.html">Calendar</a></li>
                                </ul>
                            </li>
                            <li><a href="javascript:void(0)"><i class="fa fa-laptop"></i> Landing Page <span
                                    class="label label-success pull-right">Coming Soon</span></a></li>
                        </ul>
                    </div>

                </div>
                <!-- /sidebar menu -->

                <!-- /menu footer buttons -->
                <div class="sidebar-footer hidden-small">
                    <a data-toggle="tooltip" data-placement="top" title="设置">
                        <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
                    </a>
                    <a data-toggle="tooltip" data-placement="top" title="全屏">
                        <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
                    </a>
                    <a data-toggle="tooltip" data-placement="top" title="锁">
                        <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
                    </a>
                    <a data-toggle="tooltip" data-placement="top" href="/bu/loginout" title="退出">
                        <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
                    </a>
                </div>
                <!-- /menu footer buttons -->
            </div>
        </div>

        <!-- top navigation -->
        <div class="top_nav">
            <div class="nav_menu">
                <nav>
                    <div class="nav toggle">
                        <a id="menu_toggle"><i class="fa fa-bars"></i></a>
                    </div>

                    <ul class="nav navbar-nav navbar-right">
                        <li class="">
                            <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown"
                               aria-expanded="false">
                                <img src="images/img.jpg" alt="">${user.usercode}
                                <span class=" fa fa-angle-down"></span>
                            </a>
                            <ul class="dropdown-menu dropdown-usermenu pull-right">
                                <li>
                                    <a href="javascript:;">
                                        <span class="badge bg-red pull-right">50%</span>
                                        <span>设置</span>
                                    </a>
                                </li>
                                <li><a href="javascript:;">帮助</a></li>
                                <li><a href="/bu/loginout"><i class="fa fa-sign-out pull-right"></i>退出</a></li>
                            </ul>
                        </li>

                        <li role="presentation" class="dropdown">
                            <a href="javascript:;" class="dropdown-toggle info-number" data-toggle="dropdown"
                               aria-expanded="false">
                                <i class="fa fa-envelope-o"></i>
                                <span class="badge bg-green">6</span>
                            </a>
                            <ul id="menu1" class="dropdown-menu list-unstyled msg_list" role="menu">
                                <li>
                                    <a>
                                        <span class="image"><img src="images/img.jpg" alt="Profile Image"/></span>
                        <span>
                          <span>John Smith</span>
                          <span class="time">3 mins ago</span>
                        </span>
                        <span class="message">
                          Film festivals used to be do-or-die moments for movie makers. They were where...
                        </span>
                                    </a>
                                </li>
                                <li>
                                    <a>
                                        <span class="image"><img src="images/img.jpg" alt="Profile Image"/></span>
                        <span>
                          <span>John Smith</span>
                          <span class="time">3 mins ago</span>
                        </span>
                        <span class="message">
                          Film festivals used to be do-or-die moments for movie makers. They were where...
                        </span>
                                    </a>
                                </li>
                                <li>
                                    <a>
                                        <span class="image"><img src="images/img.jpg" alt="Profile Image"/></span>
                        <span>
                          <span>John Smith</span>
                          <span class="time">3 mins ago</span>
                        </span>
                        <span class="message">
                          Film festivals used to be do-or-die moments for movie makers. They were where...
                        </span>
                                    </a>
                                </li>
                                <li>
                                    <a>
                                        <span class="image"><img src="images/img.jpg" alt="Profile Image"/></span>
                        <span>
                          <span>John Smith</span>
                          <span class="time">3 mins ago</span>
                        </span>
                        <span class="message">
                          Film festivals used to be do-or-die moments for movie makers. They were where...
                        </span>
                                    </a>
                                </li>
                                <li>
                                    <div class="text-center">
                                        <a>
                                            <strong>See All Alerts</strong>
                                            <i class="fa fa-angle-right"></i>
                                        </a>
                                    </div>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">
                <div class="page-title">
                    <div class="title_left">
                    </div>

                    <div class="title_right">
                        <form id="bd" data-parsley-validate class="form-horizontal form-label-left"
                              action="/bu/showappinfo" method="post" >
                            <input type="hidden" name="pagenum" id="pagenum">
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">软件名称</label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <input type="text" id="first-name" class="form-control col-md-7 col-xs-12"
                                           style="width: 80px;height: 25px" name="softwarename">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">APP状态</label>
                                <select id ="status" name="status" class="status">
                                    <option value="">--请选择--</option>
                                    <%--<c:forEach var="statu" items="${datadic}">--%>
                                        <%--<option value="${statu.valueid}">${statu.valuename}</option>--%>
                                    <%--</c:forEach>--%>
                                </select>

                            </div>
                            <div class="form-group">
                                <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">所属平台</label>
                                <select id="flatformid" name="flatformid">
                                    <option value="">--请选择--</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12">一级分类</label>
                                <select id="categorylevel1" name="categorylevel1">
                                    <option value="">--请选择--</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12">二级分类</label>
                                <select  id="categorylevel2" name="categorylevel2">
                                    <option value="">--请选择--</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12">三级分类</label>
                                <select id="categorylevel3" name="categorylevel3">
                                    <option value="">--请选择--</option>
                                </select>
                            </div>
                            <br/>

                            <button type="submit" class="btn btn-success">查询</button>
                   </form>
                    </div>
                </div>
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>
                                <small>App信息展示</small>
                            </h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                                       aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a href="#">Settings 1</a>
                                        </li>
                                        <li><a href="#">Settings 2</a>
                                        </li>
                                    </ul>
                                </li>
                                <li><a class="close-link"><i class="fa fa-close"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content">
                            <p class="text-muted font-13 m-b-30">
                                <a href="/bu/add" name="add"  class="btn btn-round btn-success">新增APP基础信息</a>&nbsp;&nbsp; <a href="/appversion/add" name="add"  class="btn btn-round btn-success">新增APP版本信息</a>
                            </p>
                            <table id="datatable-checkbox" class="table table-striped table-bordered bulk_action">
                                <thead>
                                <tr>
                                    <th><input type="checkbox" id="check-all" class="flat"></th>
                                    <th>软件名称</th>
                                    <th>APK名称</th>
                                    <th>软件大小(单位：M)</th>
                                    <th>所属平台</th>
                                    <th>所属分类(一，二，三级分类)</th>
                                    <th>状态</th>
                                    <th>下载次数</th>
                                    <th>最新版本号</th>
                                    <th>操作</th>
                                </tr>
                                </thead>

                                <c:forEach items="${appinfo.list}" var="appinfos" varStatus="ap">
                                    <tbody>
                                    <tr ${ap.index%2==0?"bgcolor='red'":''}>
                                        <td><input type="checkbox" class="flat" name="table_records"></td>
                                        <td>${appinfos.softwarename}</td>
                                        <td>${appinfos.apkname}</td>
                                        <td>${appinfos.softwaresize}</td>
                                        <td>${appinfos.flatformname}</td>
                                        <td>${appinfos.categoryLevel1name}>${appinfos.categoryLevel2name}>${appinfos.categoryLevel3name}</td>
                                            <%--versionNo;--%>
                                            <%--statusname;--%>
                                            <%--flatformname;--%>
                                            <%--${appinfos.categoryLevel1name}>${appinfos.categoryLevel2name}>${appinfos.categoryLevel3name}--%>
                                        <td>${appinfos.statusname}</td>
                                        <td>${appinfos.downloads}</td>
                                        <td>${appinfos.versionNo}</td>
                                        <td>

                                            <!-- Split button -->
                                            <div class="btn-group">
                                                <button type="button" class="btn btn-danger" style="font-size: 10px">
                                                    点击操作
                                                </button>
                                                <button type="button" class="btn btn-danger dropdown-toggle"
                                                        data-toggle="dropdown" aria-expanded="false">
                                                    <span class="caret"></span>
                                                    <span class="sr-only">Toggle Dropdown</span>
                                                </button>
                                                <ul class="dropdown-menu" role="menu">
                                                    <li><a class="showinfo_json" href="javascript:;"
                                                           id="${appinfos.id}">查看</a></li>
                                                    <li><a href="#">删除</a></li>
                                                    <li class="divider">修改</li>
                                                    <li><a href="/bu/put?id=${appinfos.id}">上架</a></li>
                                                    <li><a href="/bu/soldout?id=${appinfos.id}">上架</a></li>
                                                        <%--<li><a  class="showinfo_json" href="javascript:;" id="${appinfos.id}" >审核</a></li>--%>
                                                    <li>
                                                        <a  class="chackApp"
                                                                id="${appinfos.id}" versionid="${appinfos.versionid}"
                                                                status="${appinfos.status}"
                                                                statusname="${appinfos.statusname}">查看并审核App
                                                        </a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </c:forEach>
                                <tfoot>
                                <tr>
                                    <td colspan="10">
                                        <a href="javascript:pageshow(1)">首页</a>
                                        <a href="javascript:pageshow(${appinfo.pagenum-1<1?1:appinfo.pagenum-1})">上一页</a>
                                        <a href="javascript:pageshow(${appinfo.pagenum+1>appinfo.totapages?appinfo.totapages:appinfo.pagenum+1})">下一页</a>
                                        <a href="javascript:pageshow(${appinfo.totapages})">尾页</a>
                                        &nbsp;&nbsp;
                                        <b>第${appinfo.pagenum}页&nbsp;共${appinfo.totapages}</b>
                                    </td>
                                </tr>
                                </tfoot>
                            </table>

                            <script>
                                function pageshow(pagenum) {
                                    document.getElementById("pagenum").value = pagenum;
                                    document.getElementById("bd").submit();
                                }
                            </script>
                        </div>
                    </div>
                </div>
                <!-- footer content -->
                <footer>

                    <br/>
                    <form id="demo-form2" data-parsley-validate="" class="form-horizontal form-label-left"
                          novalidate="">

                        <div class="form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">软件名称*<span
                                    class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="softwarename" class="form-control col-md-7 col-xs-12" type="text" value=""
                                       readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">APK名称*<span
                                    class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="apkname" name="apkname" required="required"
                                       class="form-control col-md-7 col-xs-12" type="text" value=""
                                       readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">支持ROM</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="supportrom" class="form-control col-md-7 col-xs-12" name="middle-name"
                                       type="text" value="" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">界面语言*</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="interfacelanguage" name="last-name" required="required"
                                       class="form-control col-md-7 col-xs-12" type="text" value=""
                                       readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">软件大小*</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="softwaresize" class="form-control col-md-7 col-xs-12" name="middle-name"
                                       type="text" value="" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">下载次数*</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="downloads" class="form-control col-md-7 col-xs-12" name="middle-name"
                                       type="text" value="" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">所属平台*</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="flatformname" class="form-control col-md-7 col-xs-12" name="middle-name"
                                       type="text" value="" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">一级分类*</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <%--${appinfos.categoryLevel1name}>${appinfos.categoryLevel2name}>${appinfos.categoryLevel3name}--%>
                                <input id="categoryLevel1name" class="form-control col-md-7 col-xs-12"
                                       name="middle-name" type="text" value="" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">二级分类*</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <%--${appinfos.categoryLevel1name}>${appinfos.categoryLevel2name}>${appinfos.categoryLevel3name}--%>
                                <input id="categoryLevel2name" class="form-control col-md-7 col-xs-12"
                                       name="middle-name" type="text" value="" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">三级分类*</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <%--${appinfos.categoryLevel1name}>${appinfos.categoryLevel2name}>${appinfos.categoryLevel3name}--%>
                                <input id="categoryLevel3name" class="form-control col-md-7 col-xs-12"
                                       name="middle-name" type="text" value="" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">APP状态*</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="statusname" class="form-control col-md-7 col-xs-12" name="middle-name"
                                       type="text" value="" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">应用简介*</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="appinfo" class="form-control col-md-7 col-xs-12" name="appinfo" type="text"
                                       value="" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">LOGO图片</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <img id="logopicpath" src="/statics/images/logo/${appinfoshow.logopicpath}"
                                     alt="logo图片">
                            </div>
                        </div>
                    </form>
                    <div class="pull-right">
                        Gentelella - Bootstrap Admin Template by <a href="https://colorlib.com">Colorlib</a>
                    </div>
                    <div class="clearfix"></div>
                </footer>
                <!-- /footer content -->
            </div>
        </div>

        <!-- jQuery -->
        <script src="/statics/js/jquery.min.js"></script>
        <!-- Bootstrap -->
        <script src="/statics/js/bootstrap.min.js"></script>
        <!-- FastClick -->
        <script src="/statics/js/fastclick.js"></script>
        <!-- NProgress -->
        <script src="/statics/js/nprogress.js"></script>
        <!-- iCheck -->
        <script src="/statics/js/icheck.min.js"></script>
        <!-- Datatables -->
        <script src="/statics/datatables.net/js/jquery.dataTables.min.js"></script>
        <script src="/statics/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
        <script src="/statics/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
        <script src="/statics/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
        <script src="/statics/datatables.net-buttons/js/buttons.flash.min.js"></script>
        <script src="/statics/datatables.net-buttons/js/buttons.html5.min.js"></script>
        <script src="/statics/datatables.net-buttons/js/buttons.print.min.js"></script>
        <script src="/statics/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
        <script src="/statics/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
        <script src="/statics/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
        <script src="/statics/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
        <script src="/statics/datatables.net-scroller/js/dataTables.scroller.min.js"></script>
        <script src="/statics/js/jszip.min.js"></script>
        <script src="/statics/js/build/pdfmake.min.js"></script>
        <script src="/statics/js/build/vfs_fonts.js"></script>

        <!-- Custom Theme Scripts -->
        <script src="/statics/js/custom.min.js"></script>

        <!-- Datatables -->
                <script>
                    //ajax查询app状态
                    var urlStatus="/data/selectSatus";
                    var paramStatus={typecode:"APP_STATUS"};
                    $.getJSON(urlStatus,paramStatus,function (responseData) {
                        $.each(responseData,function (index,dataDictionary){
                            $("#status").append("<option value='"+dataDictionary.valueid+"'>"+dataDictionary.valuename+"</option>")
                        })
                    });
                    //ajax查询所属平台
                    var urlPlantfrom="/data/selectSatus";
                    var paramPlantfrom={typecode:"APP_FLATFORM"};
                    $.getJSON(urlPlantfrom,paramPlantfrom,function (responseData) {
                        $.each(responseData,function (index,dataDictionary){

                            $("#flatformid").append("<option value='"+dataDictionary.valueid+"'>"+dataDictionary.valuename+"</option>")
                        })
                    });

                    //ajax查询分类1
                    var urlLevel1="/category/queryCategory";
                    var paramLevel1={level:"level1"};
                    $.getJSON(urlLevel1,paramLevel1,function (reponseData) {
                        $.each(reponseData,function (index,appCategory){
                            $("#categorylevel1").append("<option value='"+appCategory.id+"'>"+appCategory.categoryname+"</option>")
                        })
                    });
                    //ajax查询分类2
                    var urlLevel2="/category/queryCategory";
                    var paramLevel2={level:"level2"};
                    $.getJSON(urlLevel2,paramLevel2,function (reponseData) {
                        $.each(reponseData,function (index,appCategory){
                            $("#categorylevel2").append("<option value='"+appCategory.id+"'>"+appCategory.categoryname+"</option>")
                        })
                    });
                    //ajax查询分类3
                    var urlLevel3="/category/queryCategory";
                    var paramLevel3={level:"level3"};
                    $.getJSON(urlLevel3,paramLevel3,function (reponseData) {
                        $.each(reponseData,function (index,appCategory){
                            $("#categorylevel3").append("<option value='"+appCategory.id+"'>"+appCategory.categoryname+"</option>")
                        })
                    });

                    $(".showinfo_json").on("click", function () {
                        var obj = $(this);
                        $.ajax({
                            type: "GET",
                            url: "/bu/afshowJSON",
                            data: {id: obj.attr("id")},
                            dataType: "json",
                            success: function (resoult) {
                                if ("null" == resoult) {
                                    alert("没有数据")
                                } else {
                                    $("#softwarename").val(resoult.softwarename);
                                    $("#apkname").val(resoult.apkname);
                                    $("#supportrom").val(resoult.supportrom);
                                    $("#interfacelanguage").val(resoult.interfacelanguage);
                                    $("#softwaresize").val(resoult.softwaresize);
                                    $("#downloads").val(resoult.downloads);
                                    $("#flatformname").val(resoult.flatformname);
                                    $("#categoryLevel1name").val(resoult.categoryLevel1name);
                                    $("#categoryLevel2name").val(resoult.categoryLevel2name);
                                    $("#categoryLevel3name").val(resoult.categoryLevel3name);
                                    $("#statusname").val(resoult.statusname);
                                    $("#appinfo").val(resoult.appinfo);
                                    $("#logopicpath").val(resoult.logopicpath);
                                }
                    },
                    error: function (data) {
                        alert("error!")
                    }
                })

            });
            $(".chackApp").on("click", function () {
                var obj = $(this);
                var status = obj.attr("status");
                var vid = obj.attr("versionid");

                if (status == "1" && vid != "" && vid != null) {
                    //待审核状态下可以进行审核操作
                    window.location.href = "/bu/check?aid=" + obj.attr("id") + "&vid=" + obj.attr("versionid");
                } else if (vid != "" || vid != null) {
                    alert("该App应用没有上传最新版本，不能进行审核操作！")
                } else if (status != "1") {
                    alert("该APP应用的状态为：【" + obj.attr("statusname") + "】,不能进行审核操作！");
                }
            });
            $(document).ready(function () {
                var handleDataTableButtons = function () {
                    if ($("#datatable-buttons").length) {
                        $("#datatable-buttons").DataTable({
                            dom: "Bfrtip",
                            buttons: [
                                {
                                    extend: "copy",
                                    className: "btn-sm"
                                },
                                {
                                    extend: "csv",
                                    className: "btn-sm"
                                },
                                {
                                    extend: "excel",
                                    className: "btn-sm"
                                },
                                {
                                    extend: "pdfHtml5",
                                    className: "btn-sm"
                                },
                                {
                                    extend: "print",
                                    className: "btn-sm"
                                },
                            ],
                            responsive: true
                        });
                    }
                };

                TableManageButtons = function () {
                    "use strict";
                    return {
                        init: function () {
                            handleDataTableButtons();
                        }
                    };
                }();

                $('#datatable').dataTable();

                $('#datatable-keytable').DataTable({
                    keys: true
                });

                $('#datatable-responsive').DataTable();

                $('#datatable-scroller').DataTable({
                    ajax: "js/datatables/json/scroller-demo.json",
                    deferRender: true,
                    scrollY: 380,
                    scrollCollapse: true,
                    scroller: true
                });

                $('#datatable-fixed-header').DataTable({
                    fixedHeader: true
                });

                var $datatable = $('#datatable-checkbox');

                $datatable.dataTable({
                    'order': [[1, 'asc']],
                    'columnDefs': [
                        {orderable: false, targets: [0]}
                    ]
                });
                $datatable.on('draw.dt', function () {
                    $('input').iCheck({
                        checkboxClass: 'icheckbox_flat-green'
                    });
                });

                TableManageButtons.init();
            });
        </script>
        <!-- /Datatables -->
</body>
</html>
